﻿using System.Xml;
using System.Xml.Serialization;

namespace Wix.Win8SetupBootstrapper.Classes
{
    public class BundleInfoLoader
    {
        public static BundleInfo Load()
        {
            string path = "BootstrapperApplicationData.xml";
            string path2 = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), path);
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(BundleInfo));
            BundleInfo result;
            using (System.IO.FileStream fileStream = new System.IO.FileStream(path2, System.IO.FileMode.Open))
            {
                XmlReader xmlReader = XmlReader.Create(fileStream);
                result = (BundleInfo)xmlSerializer.Deserialize(xmlReader);
            }
            return result;
        } 
    }
}